/*
**  test_file: hipGraphTest_largeOfKernel.cpp
**  brief:  test code for large of kernel
*/
#include <hip/hip_runtime.h>
#include <chrono>
#include <vector>
#include <unistd.h>
#include <sys/time.h>
#include <iostream>
#define KNRM "\x1B[0m"
#define KRED "\x1B[31m"
#define KGRN "\x1B[32m"
#define KYEL "\x1B[33m"
#define KBLU "\x1B[34m"
#define KMAG "\x1B[35m"
#define KCYN "\x1B[36m"
#define KWHT "\x1B[37m"

#define failed(...)                                                                                \
    printf("%serror: ", KRED);                                                                     \
    printf(__VA_ARGS__);                                                                           \
    printf("\n");                                                                                  \
    printf("error: TEST FAILED\n%s", KNRM);                                                        \
    abort();

#define HIPCHECK(error)                                                                            \
    {                                                                                              \
        hipError_t localError = error;                                                             \
        if ((localError != hipSuccess) && (localError != hipErrorPeerAccessAlreadyEnabled)) {      \
            printf("%serror: '%s'(%d) from %s at %s:%d%s\n", KRED, hipGetErrorString(localError),  \
                   localError, #error, __FILE__, __LINE__, KNRM);                                  \
            failed("API returned error code.");                                                    \
        }                                                                                          \
    }

#define TESTLOOP                    1
#define TESTSIZE_OF_2_POWER_MIN     8
#define TESTSIZE_OF_2_POWER_MAX     8
#define BLOCK_SIZE_MIN              64
//#define BLOCK_SIZE_MAX              512
#define BLOCK_SIZE_MAX              64
#define GRID_SIZE_MIN               1
#define GRID_SIZE_MAX               64
#define GRAPH_KERNELS_NUM_MIN       6
#define GRAPH_KERNELS_NUM_MAX       14
#define SPACE_KERNEL                0

double getRealTime() {
    struct timeval tp = {0, 0};
    gettimeofday(&tp, NULL);
    return (double) (tp.tv_sec * 1000000 + tp.tv_usec);
}

__global__ void add(float *d_x, float *d_y, float *d_z, size_t N) {

    int i = blockIdx.x * blockDim.x + threadIdx.x;
    if (i < N) {
#if (SPACE_KERNEL == 0)
        //printf("in kernel_func: add  d_x: %p d_y: %p d_z: %p size: %zu\n", d_x, d_y, d_z, N);
        d_z[i] = d_x[i] + d_y[i];
#endif
    }
    return;
}

#define FUNC_NAME(NUM) kernel_name##NUM

#define DEFINE_ADD_KERNEL(NUM) \
__global__ void kernel_name##NUM (float *d_x, float *d_y, float *d_z, size_t N) { \
    int i = blockIdx.x * blockDim.x + threadIdx.x; \
    if (i < N) { \
        d_z[i] = d_x[i] + d_y[i]; \
    } \
    return;\
} 

DEFINE_ADD_KERNEL(1)
DEFINE_ADD_KERNEL(2)
DEFINE_ADD_KERNEL(3)
DEFINE_ADD_KERNEL(4)
DEFINE_ADD_KERNEL(5)
DEFINE_ADD_KERNEL(6)
DEFINE_ADD_KERNEL(7)
DEFINE_ADD_KERNEL(8)
DEFINE_ADD_KERNEL(9)
DEFINE_ADD_KERNEL(10)
DEFINE_ADD_KERNEL(11)
DEFINE_ADD_KERNEL(12)
DEFINE_ADD_KERNEL(13)
DEFINE_ADD_KERNEL(14)
DEFINE_ADD_KERNEL(15)
DEFINE_ADD_KERNEL(16)
DEFINE_ADD_KERNEL(17)
DEFINE_ADD_KERNEL(18)
DEFINE_ADD_KERNEL(19)
DEFINE_ADD_KERNEL(20)
DEFINE_ADD_KERNEL(21)
DEFINE_ADD_KERNEL(22)
DEFINE_ADD_KERNEL(23)
DEFINE_ADD_KERNEL(24)
DEFINE_ADD_KERNEL(25)
DEFINE_ADD_KERNEL(26)
DEFINE_ADD_KERNEL(27)
DEFINE_ADD_KERNEL(28)
DEFINE_ADD_KERNEL(29)
DEFINE_ADD_KERNEL(30)
DEFINE_ADD_KERNEL(31)
DEFINE_ADD_KERNEL(32)
DEFINE_ADD_KERNEL(33)
DEFINE_ADD_KERNEL(34)
DEFINE_ADD_KERNEL(35)
DEFINE_ADD_KERNEL(36)
DEFINE_ADD_KERNEL(37)
DEFINE_ADD_KERNEL(38)
DEFINE_ADD_KERNEL(39)
DEFINE_ADD_KERNEL(40)
DEFINE_ADD_KERNEL(41)
DEFINE_ADD_KERNEL(42)
DEFINE_ADD_KERNEL(43)
DEFINE_ADD_KERNEL(44)
DEFINE_ADD_KERNEL(45)
DEFINE_ADD_KERNEL(46)
DEFINE_ADD_KERNEL(47)
DEFINE_ADD_KERNEL(48)
DEFINE_ADD_KERNEL(49)
DEFINE_ADD_KERNEL(50)
DEFINE_ADD_KERNEL(51)
DEFINE_ADD_KERNEL(52)
DEFINE_ADD_KERNEL(53)
DEFINE_ADD_KERNEL(54)
DEFINE_ADD_KERNEL(55)
DEFINE_ADD_KERNEL(56)
DEFINE_ADD_KERNEL(57)
DEFINE_ADD_KERNEL(58)
DEFINE_ADD_KERNEL(59)
DEFINE_ADD_KERNEL(60)
DEFINE_ADD_KERNEL(61)
DEFINE_ADD_KERNEL(62)
DEFINE_ADD_KERNEL(63)
DEFINE_ADD_KERNEL(64)
DEFINE_ADD_KERNEL(65)
DEFINE_ADD_KERNEL(66)
DEFINE_ADD_KERNEL(67)
DEFINE_ADD_KERNEL(68)
DEFINE_ADD_KERNEL(69)
DEFINE_ADD_KERNEL(70)
DEFINE_ADD_KERNEL(71)
DEFINE_ADD_KERNEL(72)
DEFINE_ADD_KERNEL(73)
DEFINE_ADD_KERNEL(74)
DEFINE_ADD_KERNEL(75)
DEFINE_ADD_KERNEL(76)
DEFINE_ADD_KERNEL(77)
DEFINE_ADD_KERNEL(78)
DEFINE_ADD_KERNEL(79)
DEFINE_ADD_KERNEL(80)
DEFINE_ADD_KERNEL(81)
DEFINE_ADD_KERNEL(82)
DEFINE_ADD_KERNEL(83)
DEFINE_ADD_KERNEL(84)
DEFINE_ADD_KERNEL(85)
DEFINE_ADD_KERNEL(86)
DEFINE_ADD_KERNEL(87)
DEFINE_ADD_KERNEL(88)
DEFINE_ADD_KERNEL(89)
DEFINE_ADD_KERNEL(90)
DEFINE_ADD_KERNEL(91)
DEFINE_ADD_KERNEL(92)
DEFINE_ADD_KERNEL(93)
DEFINE_ADD_KERNEL(94)
DEFINE_ADD_KERNEL(95)
DEFINE_ADD_KERNEL(96)
DEFINE_ADD_KERNEL(97)
DEFINE_ADD_KERNEL(98)
DEFINE_ADD_KERNEL(99)
DEFINE_ADD_KERNEL(100)
DEFINE_ADD_KERNEL(101)
DEFINE_ADD_KERNEL(102)
DEFINE_ADD_KERNEL(103)
DEFINE_ADD_KERNEL(104)
DEFINE_ADD_KERNEL(105)
DEFINE_ADD_KERNEL(106)
DEFINE_ADD_KERNEL(107)
DEFINE_ADD_KERNEL(108)
DEFINE_ADD_KERNEL(109)
DEFINE_ADD_KERNEL(110)
DEFINE_ADD_KERNEL(111)
DEFINE_ADD_KERNEL(112)
DEFINE_ADD_KERNEL(113)
DEFINE_ADD_KERNEL(114)
DEFINE_ADD_KERNEL(115)
DEFINE_ADD_KERNEL(116)
DEFINE_ADD_KERNEL(117)
DEFINE_ADD_KERNEL(118)
DEFINE_ADD_KERNEL(119)
DEFINE_ADD_KERNEL(120)
DEFINE_ADD_KERNEL(121)
DEFINE_ADD_KERNEL(122)
DEFINE_ADD_KERNEL(123)
DEFINE_ADD_KERNEL(124)
DEFINE_ADD_KERNEL(125)
DEFINE_ADD_KERNEL(126)
DEFINE_ADD_KERNEL(127)
DEFINE_ADD_KERNEL(128)
DEFINE_ADD_KERNEL(129)
DEFINE_ADD_KERNEL(130)
DEFINE_ADD_KERNEL(131)
DEFINE_ADD_KERNEL(132)
DEFINE_ADD_KERNEL(133)
DEFINE_ADD_KERNEL(134)
DEFINE_ADD_KERNEL(135)
DEFINE_ADD_KERNEL(136)
DEFINE_ADD_KERNEL(137)
DEFINE_ADD_KERNEL(138)
DEFINE_ADD_KERNEL(139)
DEFINE_ADD_KERNEL(140)
DEFINE_ADD_KERNEL(141)
DEFINE_ADD_KERNEL(142)
DEFINE_ADD_KERNEL(143)
DEFINE_ADD_KERNEL(144)
DEFINE_ADD_KERNEL(145)
DEFINE_ADD_KERNEL(146)
DEFINE_ADD_KERNEL(147)
DEFINE_ADD_KERNEL(148)
DEFINE_ADD_KERNEL(149)
DEFINE_ADD_KERNEL(150)
DEFINE_ADD_KERNEL(151)
DEFINE_ADD_KERNEL(152)
DEFINE_ADD_KERNEL(153)
DEFINE_ADD_KERNEL(154)
DEFINE_ADD_KERNEL(155)
DEFINE_ADD_KERNEL(156)
DEFINE_ADD_KERNEL(157)
DEFINE_ADD_KERNEL(158)
DEFINE_ADD_KERNEL(159)
DEFINE_ADD_KERNEL(160)
DEFINE_ADD_KERNEL(161)
DEFINE_ADD_KERNEL(162)
DEFINE_ADD_KERNEL(163)
DEFINE_ADD_KERNEL(164)
DEFINE_ADD_KERNEL(165)
DEFINE_ADD_KERNEL(166)
DEFINE_ADD_KERNEL(167)
DEFINE_ADD_KERNEL(168)
DEFINE_ADD_KERNEL(169)
DEFINE_ADD_KERNEL(170)
DEFINE_ADD_KERNEL(171)
DEFINE_ADD_KERNEL(172)
DEFINE_ADD_KERNEL(173)
DEFINE_ADD_KERNEL(174)
DEFINE_ADD_KERNEL(175)
DEFINE_ADD_KERNEL(176)
DEFINE_ADD_KERNEL(177)
DEFINE_ADD_KERNEL(178)
DEFINE_ADD_KERNEL(179)
DEFINE_ADD_KERNEL(180)
DEFINE_ADD_KERNEL(181)
DEFINE_ADD_KERNEL(182)
DEFINE_ADD_KERNEL(183)
DEFINE_ADD_KERNEL(184)
DEFINE_ADD_KERNEL(185)
DEFINE_ADD_KERNEL(186)
DEFINE_ADD_KERNEL(187)
DEFINE_ADD_KERNEL(188)
DEFINE_ADD_KERNEL(189)
DEFINE_ADD_KERNEL(190)
DEFINE_ADD_KERNEL(191)
DEFINE_ADD_KERNEL(192)
DEFINE_ADD_KERNEL(193)
DEFINE_ADD_KERNEL(194)
DEFINE_ADD_KERNEL(195)
DEFINE_ADD_KERNEL(196)
DEFINE_ADD_KERNEL(197)
DEFINE_ADD_KERNEL(198)
DEFINE_ADD_KERNEL(199)
DEFINE_ADD_KERNEL(200)
DEFINE_ADD_KERNEL(201)
DEFINE_ADD_KERNEL(202)
DEFINE_ADD_KERNEL(203)
DEFINE_ADD_KERNEL(204)
DEFINE_ADD_KERNEL(205)
DEFINE_ADD_KERNEL(206)
DEFINE_ADD_KERNEL(207)
DEFINE_ADD_KERNEL(208)
DEFINE_ADD_KERNEL(209)
DEFINE_ADD_KERNEL(210)
DEFINE_ADD_KERNEL(211)
DEFINE_ADD_KERNEL(212)
DEFINE_ADD_KERNEL(213)
DEFINE_ADD_KERNEL(214)
DEFINE_ADD_KERNEL(215)
DEFINE_ADD_KERNEL(216)
DEFINE_ADD_KERNEL(217)
DEFINE_ADD_KERNEL(218)
DEFINE_ADD_KERNEL(219)
DEFINE_ADD_KERNEL(220)
DEFINE_ADD_KERNEL(221)
DEFINE_ADD_KERNEL(222)
DEFINE_ADD_KERNEL(223)
DEFINE_ADD_KERNEL(224)
DEFINE_ADD_KERNEL(225)
DEFINE_ADD_KERNEL(226)
DEFINE_ADD_KERNEL(227)
DEFINE_ADD_KERNEL(228)
DEFINE_ADD_KERNEL(229)
DEFINE_ADD_KERNEL(230)
DEFINE_ADD_KERNEL(231)
DEFINE_ADD_KERNEL(232)
DEFINE_ADD_KERNEL(233)
DEFINE_ADD_KERNEL(234)
DEFINE_ADD_KERNEL(235)
DEFINE_ADD_KERNEL(236)
DEFINE_ADD_KERNEL(237)
DEFINE_ADD_KERNEL(238)
DEFINE_ADD_KERNEL(239)
DEFINE_ADD_KERNEL(240)
DEFINE_ADD_KERNEL(241)
DEFINE_ADD_KERNEL(242)
DEFINE_ADD_KERNEL(243)
DEFINE_ADD_KERNEL(244)
DEFINE_ADD_KERNEL(245)
DEFINE_ADD_KERNEL(246)
DEFINE_ADD_KERNEL(247)
DEFINE_ADD_KERNEL(248)
DEFINE_ADD_KERNEL(249)
DEFINE_ADD_KERNEL(250)
DEFINE_ADD_KERNEL(251)
DEFINE_ADD_KERNEL(252)
DEFINE_ADD_KERNEL(253)
DEFINE_ADD_KERNEL(254)
DEFINE_ADD_KERNEL(255)
DEFINE_ADD_KERNEL(256)
DEFINE_ADD_KERNEL(257)
DEFINE_ADD_KERNEL(258)
DEFINE_ADD_KERNEL(259)
DEFINE_ADD_KERNEL(260)
DEFINE_ADD_KERNEL(261)
DEFINE_ADD_KERNEL(262)
DEFINE_ADD_KERNEL(263)
DEFINE_ADD_KERNEL(264)
DEFINE_ADD_KERNEL(265)
DEFINE_ADD_KERNEL(266)
DEFINE_ADD_KERNEL(267)
DEFINE_ADD_KERNEL(268)
DEFINE_ADD_KERNEL(269)
DEFINE_ADD_KERNEL(270)
DEFINE_ADD_KERNEL(271)
DEFINE_ADD_KERNEL(272)
DEFINE_ADD_KERNEL(273)
DEFINE_ADD_KERNEL(274)
DEFINE_ADD_KERNEL(275)
DEFINE_ADD_KERNEL(276)
DEFINE_ADD_KERNEL(277)
DEFINE_ADD_KERNEL(278)
DEFINE_ADD_KERNEL(279)
DEFINE_ADD_KERNEL(280)
DEFINE_ADD_KERNEL(281)
DEFINE_ADD_KERNEL(282)
DEFINE_ADD_KERNEL(283)
DEFINE_ADD_KERNEL(284)
DEFINE_ADD_KERNEL(285)
DEFINE_ADD_KERNEL(286)
DEFINE_ADD_KERNEL(287)
DEFINE_ADD_KERNEL(288)
DEFINE_ADD_KERNEL(289)
DEFINE_ADD_KERNEL(290)
DEFINE_ADD_KERNEL(291)
DEFINE_ADD_KERNEL(292)
DEFINE_ADD_KERNEL(293)
DEFINE_ADD_KERNEL(294)
DEFINE_ADD_KERNEL(295)
DEFINE_ADD_KERNEL(296)
DEFINE_ADD_KERNEL(297)
DEFINE_ADD_KERNEL(298)
DEFINE_ADD_KERNEL(299)
DEFINE_ADD_KERNEL(300)
DEFINE_ADD_KERNEL(301)
DEFINE_ADD_KERNEL(302)
DEFINE_ADD_KERNEL(303)
DEFINE_ADD_KERNEL(304)
DEFINE_ADD_KERNEL(305)
DEFINE_ADD_KERNEL(306)
DEFINE_ADD_KERNEL(307)
DEFINE_ADD_KERNEL(308)
DEFINE_ADD_KERNEL(309)
DEFINE_ADD_KERNEL(310)
DEFINE_ADD_KERNEL(311)
DEFINE_ADD_KERNEL(312)
DEFINE_ADD_KERNEL(313)
DEFINE_ADD_KERNEL(314)
DEFINE_ADD_KERNEL(315)
DEFINE_ADD_KERNEL(316)
DEFINE_ADD_KERNEL(317)
DEFINE_ADD_KERNEL(318)
DEFINE_ADD_KERNEL(319)
DEFINE_ADD_KERNEL(320)
DEFINE_ADD_KERNEL(321)
DEFINE_ADD_KERNEL(322)
DEFINE_ADD_KERNEL(323)
DEFINE_ADD_KERNEL(324)
DEFINE_ADD_KERNEL(325)
DEFINE_ADD_KERNEL(326)
DEFINE_ADD_KERNEL(327)
DEFINE_ADD_KERNEL(328)
DEFINE_ADD_KERNEL(329)
DEFINE_ADD_KERNEL(330)
DEFINE_ADD_KERNEL(331)
DEFINE_ADD_KERNEL(332)
DEFINE_ADD_KERNEL(333)
DEFINE_ADD_KERNEL(334)
DEFINE_ADD_KERNEL(335)
DEFINE_ADD_KERNEL(336)
DEFINE_ADD_KERNEL(337)
DEFINE_ADD_KERNEL(338)
DEFINE_ADD_KERNEL(339)
DEFINE_ADD_KERNEL(340)
DEFINE_ADD_KERNEL(341)
DEFINE_ADD_KERNEL(342)
DEFINE_ADD_KERNEL(343)
DEFINE_ADD_KERNEL(344)
DEFINE_ADD_KERNEL(345)
DEFINE_ADD_KERNEL(346)
DEFINE_ADD_KERNEL(347)
DEFINE_ADD_KERNEL(348)
DEFINE_ADD_KERNEL(349)
DEFINE_ADD_KERNEL(350)
DEFINE_ADD_KERNEL(351)
DEFINE_ADD_KERNEL(352)
DEFINE_ADD_KERNEL(353)
DEFINE_ADD_KERNEL(354)
DEFINE_ADD_KERNEL(355)
DEFINE_ADD_KERNEL(356)
DEFINE_ADD_KERNEL(357)
DEFINE_ADD_KERNEL(358)
DEFINE_ADD_KERNEL(359)
DEFINE_ADD_KERNEL(360)
DEFINE_ADD_KERNEL(361)
DEFINE_ADD_KERNEL(362)
DEFINE_ADD_KERNEL(363)
DEFINE_ADD_KERNEL(364)
DEFINE_ADD_KERNEL(365)
DEFINE_ADD_KERNEL(366)
DEFINE_ADD_KERNEL(367)
DEFINE_ADD_KERNEL(368)
DEFINE_ADD_KERNEL(369)
DEFINE_ADD_KERNEL(370)
DEFINE_ADD_KERNEL(371)
DEFINE_ADD_KERNEL(372)
DEFINE_ADD_KERNEL(373)
DEFINE_ADD_KERNEL(374)
DEFINE_ADD_KERNEL(375)
DEFINE_ADD_KERNEL(376)
DEFINE_ADD_KERNEL(377)
DEFINE_ADD_KERNEL(378)
DEFINE_ADD_KERNEL(379)
DEFINE_ADD_KERNEL(380)
DEFINE_ADD_KERNEL(381)
DEFINE_ADD_KERNEL(382)
DEFINE_ADD_KERNEL(383)
DEFINE_ADD_KERNEL(384)
DEFINE_ADD_KERNEL(385)
DEFINE_ADD_KERNEL(386)
DEFINE_ADD_KERNEL(387)
DEFINE_ADD_KERNEL(388)
DEFINE_ADD_KERNEL(389)
DEFINE_ADD_KERNEL(390)
DEFINE_ADD_KERNEL(391)
DEFINE_ADD_KERNEL(392)
DEFINE_ADD_KERNEL(393)
DEFINE_ADD_KERNEL(394)
DEFINE_ADD_KERNEL(395)
DEFINE_ADD_KERNEL(396)
DEFINE_ADD_KERNEL(397)
DEFINE_ADD_KERNEL(398)
DEFINE_ADD_KERNEL(399)
DEFINE_ADD_KERNEL(400)
DEFINE_ADD_KERNEL(401)
DEFINE_ADD_KERNEL(402)
DEFINE_ADD_KERNEL(403)
DEFINE_ADD_KERNEL(404)
DEFINE_ADD_KERNEL(405)
DEFINE_ADD_KERNEL(406)
DEFINE_ADD_KERNEL(407)
DEFINE_ADD_KERNEL(408)
DEFINE_ADD_KERNEL(409)
DEFINE_ADD_KERNEL(410)
DEFINE_ADD_KERNEL(411)
DEFINE_ADD_KERNEL(412)
DEFINE_ADD_KERNEL(413)
DEFINE_ADD_KERNEL(414)
DEFINE_ADD_KERNEL(415)
DEFINE_ADD_KERNEL(416)
DEFINE_ADD_KERNEL(417)
DEFINE_ADD_KERNEL(418)
DEFINE_ADD_KERNEL(419)
DEFINE_ADD_KERNEL(420)
DEFINE_ADD_KERNEL(421)
DEFINE_ADD_KERNEL(422)
DEFINE_ADD_KERNEL(423)
DEFINE_ADD_KERNEL(424)
DEFINE_ADD_KERNEL(425)
DEFINE_ADD_KERNEL(426)
DEFINE_ADD_KERNEL(427)
DEFINE_ADD_KERNEL(428)
DEFINE_ADD_KERNEL(429)
DEFINE_ADD_KERNEL(430)
DEFINE_ADD_KERNEL(431)
DEFINE_ADD_KERNEL(432)
DEFINE_ADD_KERNEL(433)
DEFINE_ADD_KERNEL(434)
DEFINE_ADD_KERNEL(435)
DEFINE_ADD_KERNEL(436)
DEFINE_ADD_KERNEL(437)
DEFINE_ADD_KERNEL(438)
DEFINE_ADD_KERNEL(439)
DEFINE_ADD_KERNEL(440)
DEFINE_ADD_KERNEL(441)
DEFINE_ADD_KERNEL(442)
DEFINE_ADD_KERNEL(443)
DEFINE_ADD_KERNEL(444)
DEFINE_ADD_KERNEL(445)
DEFINE_ADD_KERNEL(446)
DEFINE_ADD_KERNEL(447)
DEFINE_ADD_KERNEL(448)
DEFINE_ADD_KERNEL(449)
DEFINE_ADD_KERNEL(450)
DEFINE_ADD_KERNEL(451)
DEFINE_ADD_KERNEL(452)
DEFINE_ADD_KERNEL(453)
DEFINE_ADD_KERNEL(454)
DEFINE_ADD_KERNEL(455)
DEFINE_ADD_KERNEL(456)
DEFINE_ADD_KERNEL(457)
DEFINE_ADD_KERNEL(458)
DEFINE_ADD_KERNEL(459)
DEFINE_ADD_KERNEL(460)
DEFINE_ADD_KERNEL(461)
DEFINE_ADD_KERNEL(462)
DEFINE_ADD_KERNEL(463)
DEFINE_ADD_KERNEL(464)
DEFINE_ADD_KERNEL(465)
DEFINE_ADD_KERNEL(466)
DEFINE_ADD_KERNEL(467)
DEFINE_ADD_KERNEL(468)
DEFINE_ADD_KERNEL(469)
DEFINE_ADD_KERNEL(470)
DEFINE_ADD_KERNEL(471)
DEFINE_ADD_KERNEL(472)
DEFINE_ADD_KERNEL(473)
DEFINE_ADD_KERNEL(474)
DEFINE_ADD_KERNEL(475)
DEFINE_ADD_KERNEL(476)
DEFINE_ADD_KERNEL(477)
DEFINE_ADD_KERNEL(478)
DEFINE_ADD_KERNEL(479)
DEFINE_ADD_KERNEL(480)
DEFINE_ADD_KERNEL(481)
DEFINE_ADD_KERNEL(482)
DEFINE_ADD_KERNEL(483)
DEFINE_ADD_KERNEL(484)
DEFINE_ADD_KERNEL(485)
DEFINE_ADD_KERNEL(486)
DEFINE_ADD_KERNEL(487)
DEFINE_ADD_KERNEL(488)
DEFINE_ADD_KERNEL(489)
DEFINE_ADD_KERNEL(490)
DEFINE_ADD_KERNEL(491)
DEFINE_ADD_KERNEL(492)
DEFINE_ADD_KERNEL(493)
DEFINE_ADD_KERNEL(494)
DEFINE_ADD_KERNEL(495)
DEFINE_ADD_KERNEL(496)
DEFINE_ADD_KERNEL(497)
DEFINE_ADD_KERNEL(498)
DEFINE_ADD_KERNEL(499)
DEFINE_ADD_KERNEL(500)
DEFINE_ADD_KERNEL(501)
DEFINE_ADD_KERNEL(502)
DEFINE_ADD_KERNEL(503)
DEFINE_ADD_KERNEL(504)
DEFINE_ADD_KERNEL(505)
DEFINE_ADD_KERNEL(506)
DEFINE_ADD_KERNEL(507)
DEFINE_ADD_KERNEL(508)
DEFINE_ADD_KERNEL(509)
DEFINE_ADD_KERNEL(510)
DEFINE_ADD_KERNEL(511)
DEFINE_ADD_KERNEL(512)
DEFINE_ADD_KERNEL(513)
DEFINE_ADD_KERNEL(514)
DEFINE_ADD_KERNEL(515)
DEFINE_ADD_KERNEL(516)
DEFINE_ADD_KERNEL(517)
DEFINE_ADD_KERNEL(518)
DEFINE_ADD_KERNEL(519)
DEFINE_ADD_KERNEL(520)
DEFINE_ADD_KERNEL(521)
DEFINE_ADD_KERNEL(522)
DEFINE_ADD_KERNEL(523)
DEFINE_ADD_KERNEL(524)
DEFINE_ADD_KERNEL(525)
DEFINE_ADD_KERNEL(526)
DEFINE_ADD_KERNEL(527)
DEFINE_ADD_KERNEL(528)
DEFINE_ADD_KERNEL(529)
DEFINE_ADD_KERNEL(530)
DEFINE_ADD_KERNEL(531)
DEFINE_ADD_KERNEL(532)
DEFINE_ADD_KERNEL(533)
DEFINE_ADD_KERNEL(534)
DEFINE_ADD_KERNEL(535)
DEFINE_ADD_KERNEL(536)
DEFINE_ADD_KERNEL(537)
DEFINE_ADD_KERNEL(538)
DEFINE_ADD_KERNEL(539)
DEFINE_ADD_KERNEL(540)
DEFINE_ADD_KERNEL(541)
DEFINE_ADD_KERNEL(542)
DEFINE_ADD_KERNEL(543)
DEFINE_ADD_KERNEL(544)
DEFINE_ADD_KERNEL(545)
DEFINE_ADD_KERNEL(546)
DEFINE_ADD_KERNEL(547)
DEFINE_ADD_KERNEL(548)
DEFINE_ADD_KERNEL(549)
DEFINE_ADD_KERNEL(550)
DEFINE_ADD_KERNEL(551)
DEFINE_ADD_KERNEL(552)
DEFINE_ADD_KERNEL(553)
DEFINE_ADD_KERNEL(554)
DEFINE_ADD_KERNEL(555)
DEFINE_ADD_KERNEL(556)
DEFINE_ADD_KERNEL(557)
DEFINE_ADD_KERNEL(558)
DEFINE_ADD_KERNEL(559)
DEFINE_ADD_KERNEL(560)
DEFINE_ADD_KERNEL(561)
DEFINE_ADD_KERNEL(562)
DEFINE_ADD_KERNEL(563)
DEFINE_ADD_KERNEL(564)
DEFINE_ADD_KERNEL(565)
DEFINE_ADD_KERNEL(566)
DEFINE_ADD_KERNEL(567)
DEFINE_ADD_KERNEL(568)
DEFINE_ADD_KERNEL(569)
DEFINE_ADD_KERNEL(570)
DEFINE_ADD_KERNEL(571)
DEFINE_ADD_KERNEL(572)
DEFINE_ADD_KERNEL(573)
DEFINE_ADD_KERNEL(574)
DEFINE_ADD_KERNEL(575)
DEFINE_ADD_KERNEL(576)
DEFINE_ADD_KERNEL(577)
DEFINE_ADD_KERNEL(578)
DEFINE_ADD_KERNEL(579)
DEFINE_ADD_KERNEL(580)
DEFINE_ADD_KERNEL(581)
DEFINE_ADD_KERNEL(582)
DEFINE_ADD_KERNEL(583)
DEFINE_ADD_KERNEL(584)
DEFINE_ADD_KERNEL(585)
DEFINE_ADD_KERNEL(586)
DEFINE_ADD_KERNEL(587)
DEFINE_ADD_KERNEL(588)
DEFINE_ADD_KERNEL(589)
DEFINE_ADD_KERNEL(590)
DEFINE_ADD_KERNEL(591)
DEFINE_ADD_KERNEL(592)
DEFINE_ADD_KERNEL(593)
DEFINE_ADD_KERNEL(594)
DEFINE_ADD_KERNEL(595)
DEFINE_ADD_KERNEL(596)
DEFINE_ADD_KERNEL(597)
DEFINE_ADD_KERNEL(598)
DEFINE_ADD_KERNEL(599)
DEFINE_ADD_KERNEL(600)
DEFINE_ADD_KERNEL(601)
DEFINE_ADD_KERNEL(602)
DEFINE_ADD_KERNEL(603)
DEFINE_ADD_KERNEL(604)
DEFINE_ADD_KERNEL(605)
DEFINE_ADD_KERNEL(606)
DEFINE_ADD_KERNEL(607)
DEFINE_ADD_KERNEL(608)
DEFINE_ADD_KERNEL(609)
DEFINE_ADD_KERNEL(610)
DEFINE_ADD_KERNEL(611)
DEFINE_ADD_KERNEL(612)
DEFINE_ADD_KERNEL(613)
DEFINE_ADD_KERNEL(614)
DEFINE_ADD_KERNEL(615)
DEFINE_ADD_KERNEL(616)
DEFINE_ADD_KERNEL(617)
DEFINE_ADD_KERNEL(618)
DEFINE_ADD_KERNEL(619)
DEFINE_ADD_KERNEL(620)
DEFINE_ADD_KERNEL(621)
DEFINE_ADD_KERNEL(622)
DEFINE_ADD_KERNEL(623)
DEFINE_ADD_KERNEL(624)
DEFINE_ADD_KERNEL(625)
DEFINE_ADD_KERNEL(626)
DEFINE_ADD_KERNEL(627)
DEFINE_ADD_KERNEL(628)
DEFINE_ADD_KERNEL(629)
DEFINE_ADD_KERNEL(630)
DEFINE_ADD_KERNEL(631)
DEFINE_ADD_KERNEL(632)
DEFINE_ADD_KERNEL(633)
DEFINE_ADD_KERNEL(634)
DEFINE_ADD_KERNEL(635)
DEFINE_ADD_KERNEL(636)
DEFINE_ADD_KERNEL(637)
DEFINE_ADD_KERNEL(638)
DEFINE_ADD_KERNEL(639)
DEFINE_ADD_KERNEL(640)
DEFINE_ADD_KERNEL(641)
DEFINE_ADD_KERNEL(642)
DEFINE_ADD_KERNEL(643)
DEFINE_ADD_KERNEL(644)
DEFINE_ADD_KERNEL(645)
DEFINE_ADD_KERNEL(646)
DEFINE_ADD_KERNEL(647)
DEFINE_ADD_KERNEL(648)
DEFINE_ADD_KERNEL(649)
DEFINE_ADD_KERNEL(650)
DEFINE_ADD_KERNEL(651)
DEFINE_ADD_KERNEL(652)
DEFINE_ADD_KERNEL(653)
DEFINE_ADD_KERNEL(654)
DEFINE_ADD_KERNEL(655)
DEFINE_ADD_KERNEL(656)
DEFINE_ADD_KERNEL(657)
DEFINE_ADD_KERNEL(658)
DEFINE_ADD_KERNEL(659)
DEFINE_ADD_KERNEL(660)
DEFINE_ADD_KERNEL(661)
DEFINE_ADD_KERNEL(662)
DEFINE_ADD_KERNEL(663)
DEFINE_ADD_KERNEL(664)
DEFINE_ADD_KERNEL(665)
DEFINE_ADD_KERNEL(666)
DEFINE_ADD_KERNEL(667)
DEFINE_ADD_KERNEL(668)
DEFINE_ADD_KERNEL(669)
DEFINE_ADD_KERNEL(670)
DEFINE_ADD_KERNEL(671)
DEFINE_ADD_KERNEL(672)
DEFINE_ADD_KERNEL(673)
DEFINE_ADD_KERNEL(674)
DEFINE_ADD_KERNEL(675)
DEFINE_ADD_KERNEL(676)
DEFINE_ADD_KERNEL(677)
DEFINE_ADD_KERNEL(678)
DEFINE_ADD_KERNEL(679)
DEFINE_ADD_KERNEL(680)
DEFINE_ADD_KERNEL(681)
DEFINE_ADD_KERNEL(682)
DEFINE_ADD_KERNEL(683)
DEFINE_ADD_KERNEL(684)
DEFINE_ADD_KERNEL(685)
DEFINE_ADD_KERNEL(686)
DEFINE_ADD_KERNEL(687)
DEFINE_ADD_KERNEL(688)
DEFINE_ADD_KERNEL(689)
DEFINE_ADD_KERNEL(690)
DEFINE_ADD_KERNEL(691)
DEFINE_ADD_KERNEL(692)
DEFINE_ADD_KERNEL(693)
DEFINE_ADD_KERNEL(694)
DEFINE_ADD_KERNEL(695)
DEFINE_ADD_KERNEL(696)
DEFINE_ADD_KERNEL(697)
DEFINE_ADD_KERNEL(698)
DEFINE_ADD_KERNEL(699)
DEFINE_ADD_KERNEL(700)
DEFINE_ADD_KERNEL(701)
DEFINE_ADD_KERNEL(702)
DEFINE_ADD_KERNEL(703)
DEFINE_ADD_KERNEL(704)
DEFINE_ADD_KERNEL(705)
DEFINE_ADD_KERNEL(706)
DEFINE_ADD_KERNEL(707)
DEFINE_ADD_KERNEL(708)
DEFINE_ADD_KERNEL(709)
DEFINE_ADD_KERNEL(710)
DEFINE_ADD_KERNEL(711)
DEFINE_ADD_KERNEL(712)
DEFINE_ADD_KERNEL(713)
DEFINE_ADD_KERNEL(714)
DEFINE_ADD_KERNEL(715)
DEFINE_ADD_KERNEL(716)
DEFINE_ADD_KERNEL(717)
DEFINE_ADD_KERNEL(718)
DEFINE_ADD_KERNEL(719)
DEFINE_ADD_KERNEL(720)
DEFINE_ADD_KERNEL(721)
DEFINE_ADD_KERNEL(722)
DEFINE_ADD_KERNEL(723)
DEFINE_ADD_KERNEL(724)
DEFINE_ADD_KERNEL(725)
DEFINE_ADD_KERNEL(726)
DEFINE_ADD_KERNEL(727)
DEFINE_ADD_KERNEL(728)
DEFINE_ADD_KERNEL(729)
DEFINE_ADD_KERNEL(730)
DEFINE_ADD_KERNEL(731)
DEFINE_ADD_KERNEL(732)
DEFINE_ADD_KERNEL(733)
DEFINE_ADD_KERNEL(734)
DEFINE_ADD_KERNEL(735)
DEFINE_ADD_KERNEL(736)
DEFINE_ADD_KERNEL(737)
DEFINE_ADD_KERNEL(738)
DEFINE_ADD_KERNEL(739)
DEFINE_ADD_KERNEL(740)
DEFINE_ADD_KERNEL(741)
DEFINE_ADD_KERNEL(742)
DEFINE_ADD_KERNEL(743)
DEFINE_ADD_KERNEL(744)
DEFINE_ADD_KERNEL(745)
DEFINE_ADD_KERNEL(746)
DEFINE_ADD_KERNEL(747)
DEFINE_ADD_KERNEL(748)
DEFINE_ADD_KERNEL(749)
DEFINE_ADD_KERNEL(750)
DEFINE_ADD_KERNEL(751)
DEFINE_ADD_KERNEL(752)
DEFINE_ADD_KERNEL(753)
DEFINE_ADD_KERNEL(754)
DEFINE_ADD_KERNEL(755)
DEFINE_ADD_KERNEL(756)
DEFINE_ADD_KERNEL(757)
DEFINE_ADD_KERNEL(758)
DEFINE_ADD_KERNEL(759)
DEFINE_ADD_KERNEL(760)
DEFINE_ADD_KERNEL(761)
DEFINE_ADD_KERNEL(762)
DEFINE_ADD_KERNEL(763)
DEFINE_ADD_KERNEL(764)
DEFINE_ADD_KERNEL(765)
DEFINE_ADD_KERNEL(766)
DEFINE_ADD_KERNEL(767)
DEFINE_ADD_KERNEL(768)
DEFINE_ADD_KERNEL(769)
DEFINE_ADD_KERNEL(770)
DEFINE_ADD_KERNEL(771)
DEFINE_ADD_KERNEL(772)
DEFINE_ADD_KERNEL(773)
DEFINE_ADD_KERNEL(774)
DEFINE_ADD_KERNEL(775)
DEFINE_ADD_KERNEL(776)
DEFINE_ADD_KERNEL(777)
DEFINE_ADD_KERNEL(778)
DEFINE_ADD_KERNEL(779)
DEFINE_ADD_KERNEL(780)
DEFINE_ADD_KERNEL(781)
DEFINE_ADD_KERNEL(782)
DEFINE_ADD_KERNEL(783)
DEFINE_ADD_KERNEL(784)
DEFINE_ADD_KERNEL(785)
DEFINE_ADD_KERNEL(786)
DEFINE_ADD_KERNEL(787)
DEFINE_ADD_KERNEL(788)
DEFINE_ADD_KERNEL(789)
DEFINE_ADD_KERNEL(790)
DEFINE_ADD_KERNEL(791)
DEFINE_ADD_KERNEL(792)
DEFINE_ADD_KERNEL(793)
DEFINE_ADD_KERNEL(794)
DEFINE_ADD_KERNEL(795)
DEFINE_ADD_KERNEL(796)
DEFINE_ADD_KERNEL(797)
DEFINE_ADD_KERNEL(798)
DEFINE_ADD_KERNEL(799)
DEFINE_ADD_KERNEL(800)
DEFINE_ADD_KERNEL(801)
DEFINE_ADD_KERNEL(802)
DEFINE_ADD_KERNEL(803)
DEFINE_ADD_KERNEL(804)
DEFINE_ADD_KERNEL(805)
DEFINE_ADD_KERNEL(806)
DEFINE_ADD_KERNEL(807)
DEFINE_ADD_KERNEL(808)
DEFINE_ADD_KERNEL(809)
DEFINE_ADD_KERNEL(810)
DEFINE_ADD_KERNEL(811)
DEFINE_ADD_KERNEL(812)
DEFINE_ADD_KERNEL(813)
DEFINE_ADD_KERNEL(814)
DEFINE_ADD_KERNEL(815)
DEFINE_ADD_KERNEL(816)
DEFINE_ADD_KERNEL(817)
DEFINE_ADD_KERNEL(818)
DEFINE_ADD_KERNEL(819)
DEFINE_ADD_KERNEL(820)
DEFINE_ADD_KERNEL(821)
DEFINE_ADD_KERNEL(822)
DEFINE_ADD_KERNEL(823)
DEFINE_ADD_KERNEL(824)
DEFINE_ADD_KERNEL(825)
DEFINE_ADD_KERNEL(826)
DEFINE_ADD_KERNEL(827)
DEFINE_ADD_KERNEL(828)
DEFINE_ADD_KERNEL(829)
DEFINE_ADD_KERNEL(830)
DEFINE_ADD_KERNEL(831)
DEFINE_ADD_KERNEL(832)
DEFINE_ADD_KERNEL(833)
DEFINE_ADD_KERNEL(834)
DEFINE_ADD_KERNEL(835)
DEFINE_ADD_KERNEL(836)
DEFINE_ADD_KERNEL(837)
DEFINE_ADD_KERNEL(838)
DEFINE_ADD_KERNEL(839)
DEFINE_ADD_KERNEL(840)
DEFINE_ADD_KERNEL(841)
DEFINE_ADD_KERNEL(842)
DEFINE_ADD_KERNEL(843)
DEFINE_ADD_KERNEL(844)
DEFINE_ADD_KERNEL(845)
DEFINE_ADD_KERNEL(846)
DEFINE_ADD_KERNEL(847)
DEFINE_ADD_KERNEL(848)
DEFINE_ADD_KERNEL(849)
DEFINE_ADD_KERNEL(850)
DEFINE_ADD_KERNEL(851)
DEFINE_ADD_KERNEL(852)
DEFINE_ADD_KERNEL(853)
DEFINE_ADD_KERNEL(854)
DEFINE_ADD_KERNEL(855)
DEFINE_ADD_KERNEL(856)
DEFINE_ADD_KERNEL(857)
DEFINE_ADD_KERNEL(858)
DEFINE_ADD_KERNEL(859)
DEFINE_ADD_KERNEL(860)
DEFINE_ADD_KERNEL(861)
DEFINE_ADD_KERNEL(862)
DEFINE_ADD_KERNEL(863)
DEFINE_ADD_KERNEL(864)
DEFINE_ADD_KERNEL(865)
DEFINE_ADD_KERNEL(866)
DEFINE_ADD_KERNEL(867)
DEFINE_ADD_KERNEL(868)
DEFINE_ADD_KERNEL(869)
DEFINE_ADD_KERNEL(870)
DEFINE_ADD_KERNEL(871)
DEFINE_ADD_KERNEL(872)
DEFINE_ADD_KERNEL(873)
DEFINE_ADD_KERNEL(874)
DEFINE_ADD_KERNEL(875)
DEFINE_ADD_KERNEL(876)
DEFINE_ADD_KERNEL(877)
DEFINE_ADD_KERNEL(878)
DEFINE_ADD_KERNEL(879)
DEFINE_ADD_KERNEL(880)
DEFINE_ADD_KERNEL(881)
DEFINE_ADD_KERNEL(882)
DEFINE_ADD_KERNEL(883)
DEFINE_ADD_KERNEL(884)
DEFINE_ADD_KERNEL(885)
DEFINE_ADD_KERNEL(886)
DEFINE_ADD_KERNEL(887)
DEFINE_ADD_KERNEL(888)
DEFINE_ADD_KERNEL(889)
DEFINE_ADD_KERNEL(890)
DEFINE_ADD_KERNEL(891)
DEFINE_ADD_KERNEL(892)
DEFINE_ADD_KERNEL(893)
DEFINE_ADD_KERNEL(894)
DEFINE_ADD_KERNEL(895)
DEFINE_ADD_KERNEL(896)
DEFINE_ADD_KERNEL(897)
DEFINE_ADD_KERNEL(898)
DEFINE_ADD_KERNEL(899)
DEFINE_ADD_KERNEL(900)
DEFINE_ADD_KERNEL(901)
DEFINE_ADD_KERNEL(902)
DEFINE_ADD_KERNEL(903)
DEFINE_ADD_KERNEL(904)
DEFINE_ADD_KERNEL(905)
DEFINE_ADD_KERNEL(906)
DEFINE_ADD_KERNEL(907)
DEFINE_ADD_KERNEL(908)
DEFINE_ADD_KERNEL(909)
DEFINE_ADD_KERNEL(910)
DEFINE_ADD_KERNEL(911)
DEFINE_ADD_KERNEL(912)
DEFINE_ADD_KERNEL(913)
DEFINE_ADD_KERNEL(914)
DEFINE_ADD_KERNEL(915)
DEFINE_ADD_KERNEL(916)
DEFINE_ADD_KERNEL(917)
DEFINE_ADD_KERNEL(918)
DEFINE_ADD_KERNEL(919)
DEFINE_ADD_KERNEL(920)
DEFINE_ADD_KERNEL(921)
DEFINE_ADD_KERNEL(922)
DEFINE_ADD_KERNEL(923)
DEFINE_ADD_KERNEL(924)
DEFINE_ADD_KERNEL(925)
DEFINE_ADD_KERNEL(926)
DEFINE_ADD_KERNEL(927)
DEFINE_ADD_KERNEL(928)
DEFINE_ADD_KERNEL(929)
DEFINE_ADD_KERNEL(930)
DEFINE_ADD_KERNEL(931)
DEFINE_ADD_KERNEL(932)
DEFINE_ADD_KERNEL(933)
DEFINE_ADD_KERNEL(934)
DEFINE_ADD_KERNEL(935)
DEFINE_ADD_KERNEL(936)
DEFINE_ADD_KERNEL(937)
DEFINE_ADD_KERNEL(938)
DEFINE_ADD_KERNEL(939)
DEFINE_ADD_KERNEL(940)
DEFINE_ADD_KERNEL(941)
DEFINE_ADD_KERNEL(942)
DEFINE_ADD_KERNEL(943)
DEFINE_ADD_KERNEL(944)
DEFINE_ADD_KERNEL(945)
DEFINE_ADD_KERNEL(946)
DEFINE_ADD_KERNEL(947)
DEFINE_ADD_KERNEL(948)
DEFINE_ADD_KERNEL(949)
DEFINE_ADD_KERNEL(950)
DEFINE_ADD_KERNEL(951)
DEFINE_ADD_KERNEL(952)
DEFINE_ADD_KERNEL(953)
DEFINE_ADD_KERNEL(954)
DEFINE_ADD_KERNEL(955)
DEFINE_ADD_KERNEL(956)
DEFINE_ADD_KERNEL(957)
DEFINE_ADD_KERNEL(958)
DEFINE_ADD_KERNEL(959)
DEFINE_ADD_KERNEL(960)
DEFINE_ADD_KERNEL(961)
DEFINE_ADD_KERNEL(962)
DEFINE_ADD_KERNEL(963)
DEFINE_ADD_KERNEL(964)
DEFINE_ADD_KERNEL(965)
DEFINE_ADD_KERNEL(966)
DEFINE_ADD_KERNEL(967)
DEFINE_ADD_KERNEL(968)
DEFINE_ADD_KERNEL(969)
DEFINE_ADD_KERNEL(970)
DEFINE_ADD_KERNEL(971)
DEFINE_ADD_KERNEL(972)
DEFINE_ADD_KERNEL(973)
DEFINE_ADD_KERNEL(974)
DEFINE_ADD_KERNEL(975)
DEFINE_ADD_KERNEL(976)
DEFINE_ADD_KERNEL(977)
DEFINE_ADD_KERNEL(978)
DEFINE_ADD_KERNEL(979)
DEFINE_ADD_KERNEL(980)
DEFINE_ADD_KERNEL(981)
DEFINE_ADD_KERNEL(982)
DEFINE_ADD_KERNEL(983)
DEFINE_ADD_KERNEL(984)
DEFINE_ADD_KERNEL(985)
DEFINE_ADD_KERNEL(986)
DEFINE_ADD_KERNEL(987)
DEFINE_ADD_KERNEL(988)
DEFINE_ADD_KERNEL(989)
DEFINE_ADD_KERNEL(990)
DEFINE_ADD_KERNEL(991)
DEFINE_ADD_KERNEL(992)
DEFINE_ADD_KERNEL(993)
DEFINE_ADD_KERNEL(994)
DEFINE_ADD_KERNEL(995)
DEFINE_ADD_KERNEL(996)
DEFINE_ADD_KERNEL(997)
DEFINE_ADD_KERNEL(998)
DEFINE_ADD_KERNEL(999)
DEFINE_ADD_KERNEL(1000)

using KernelFunc = void(*)(float*, float*, float*, size_t);
KernelFunc kernel_funcs[] = {
kernel_name1,
kernel_name2,
kernel_name3,
kernel_name4,
kernel_name5,
kernel_name6,
kernel_name7,
kernel_name8,
kernel_name9,
kernel_name10,
kernel_name11,
kernel_name12,
kernel_name13,
kernel_name14,
kernel_name15,
kernel_name16,
kernel_name17,
kernel_name18,
kernel_name19,
kernel_name20,
kernel_name21,
kernel_name22,
kernel_name23,
kernel_name24,
kernel_name25,
kernel_name26,
kernel_name27,
kernel_name28,
kernel_name29,
kernel_name30,
kernel_name31,
kernel_name32,
kernel_name33,
kernel_name34,
kernel_name35,
kernel_name36,
kernel_name37,
kernel_name38,
kernel_name39,
kernel_name40,
kernel_name41,
kernel_name42,
kernel_name43,
kernel_name44,
kernel_name45,
kernel_name46,
kernel_name47,
kernel_name48,
kernel_name49,
kernel_name50,
kernel_name51,
kernel_name52,
kernel_name53,
kernel_name54,
kernel_name55,
kernel_name56,
kernel_name57,
kernel_name58,
kernel_name59,
kernel_name60,
kernel_name61,
kernel_name62,
kernel_name63,
kernel_name64,
kernel_name65,
kernel_name66,
kernel_name67,
kernel_name68,
kernel_name69,
kernel_name70,
kernel_name71,
kernel_name72,
kernel_name73,
kernel_name74,
kernel_name75,
kernel_name76,
kernel_name77,
kernel_name78,
kernel_name79,
kernel_name80,
kernel_name81,
kernel_name82,
kernel_name83,
kernel_name84,
kernel_name85,
kernel_name86,
kernel_name87,
kernel_name88,
kernel_name89,
kernel_name90,
kernel_name91,
kernel_name92,
kernel_name93,
kernel_name94,
kernel_name95,
kernel_name96,
kernel_name97,
kernel_name98,
kernel_name99,
kernel_name100,
kernel_name101,
kernel_name102,
kernel_name103,
kernel_name104,
kernel_name105,
kernel_name106,
kernel_name107,
kernel_name108,
kernel_name109,
kernel_name110,
kernel_name111,
kernel_name112,
kernel_name113,
kernel_name114,
kernel_name115,
kernel_name116,
kernel_name117,
kernel_name118,
kernel_name119,
kernel_name120,
kernel_name121,
kernel_name122,
kernel_name123,
kernel_name124,
kernel_name125,
kernel_name126,
kernel_name127,
kernel_name128,
kernel_name129,
kernel_name130,
kernel_name131,
kernel_name132,
kernel_name133,
kernel_name134,
kernel_name135,
kernel_name136,
kernel_name137,
kernel_name138,
kernel_name139,
kernel_name140,
kernel_name141,
kernel_name142,
kernel_name143,
kernel_name144,
kernel_name145,
kernel_name146,
kernel_name147,
kernel_name148,
kernel_name149,
kernel_name150,
kernel_name151,
kernel_name152,
kernel_name153,
kernel_name154,
kernel_name155,
kernel_name156,
kernel_name157,
kernel_name158,
kernel_name159,
kernel_name160,
kernel_name161,
kernel_name162,
kernel_name163,
kernel_name164,
kernel_name165,
kernel_name166,
kernel_name167,
kernel_name168,
kernel_name169,
kernel_name170,
kernel_name171,
kernel_name172,
kernel_name173,
kernel_name174,
kernel_name175,
kernel_name176,
kernel_name177,
kernel_name178,
kernel_name179,
kernel_name180,
kernel_name181,
kernel_name182,
kernel_name183,
kernel_name184,
kernel_name185,
kernel_name186,
kernel_name187,
kernel_name188,
kernel_name189,
kernel_name190,
kernel_name191,
kernel_name192,
kernel_name193,
kernel_name194,
kernel_name195,
kernel_name196,
kernel_name197,
kernel_name198,
kernel_name199,
kernel_name200,
kernel_name201,
kernel_name202,
kernel_name203,
kernel_name204,
kernel_name205,
kernel_name206,
kernel_name207,
kernel_name208,
kernel_name209,
kernel_name210,
kernel_name211,
kernel_name212,
kernel_name213,
kernel_name214,
kernel_name215,
kernel_name216,
kernel_name217,
kernel_name218,
kernel_name219,
kernel_name220,
kernel_name221,
kernel_name222,
kernel_name223,
kernel_name224,
kernel_name225,
kernel_name226,
kernel_name227,
kernel_name228,
kernel_name229,
kernel_name230,
kernel_name231,
kernel_name232,
kernel_name233,
kernel_name234,
kernel_name235,
kernel_name236,
kernel_name237,
kernel_name238,
kernel_name239,
kernel_name240,
kernel_name241,
kernel_name242,
kernel_name243,
kernel_name244,
kernel_name245,
kernel_name246,
kernel_name247,
kernel_name248,
kernel_name249,
kernel_name250,
kernel_name251,
kernel_name252,
kernel_name253,
kernel_name254,
kernel_name255,
kernel_name256,
kernel_name257,
kernel_name258,
kernel_name259,
kernel_name260,
kernel_name261,
kernel_name262,
kernel_name263,
kernel_name264,
kernel_name265,
kernel_name266,
kernel_name267,
kernel_name268,
kernel_name269,
kernel_name270,
kernel_name271,
kernel_name272,
kernel_name273,
kernel_name274,
kernel_name275,
kernel_name276,
kernel_name277,
kernel_name278,
kernel_name279,
kernel_name280,
kernel_name281,
kernel_name282,
kernel_name283,
kernel_name284,
kernel_name285,
kernel_name286,
kernel_name287,
kernel_name288,
kernel_name289,
kernel_name290,
kernel_name291,
kernel_name292,
kernel_name293,
kernel_name294,
kernel_name295,
kernel_name296,
kernel_name297,
kernel_name298,
kernel_name299,
kernel_name300,
kernel_name301,
kernel_name302,
kernel_name303,
kernel_name304,
kernel_name305,
kernel_name306,
kernel_name307,
kernel_name308,
kernel_name309,
kernel_name310,
kernel_name311,
kernel_name312,
kernel_name313,
kernel_name314,
kernel_name315,
kernel_name316,
kernel_name317,
kernel_name318,
kernel_name319,
kernel_name320,
kernel_name321,
kernel_name322,
kernel_name323,
kernel_name324,
kernel_name325,
kernel_name326,
kernel_name327,
kernel_name328,
kernel_name329,
kernel_name330,
kernel_name331,
kernel_name332,
kernel_name333,
kernel_name334,
kernel_name335,
kernel_name336,
kernel_name337,
kernel_name338,
kernel_name339,
kernel_name340,
kernel_name341,
kernel_name342,
kernel_name343,
kernel_name344,
kernel_name345,
kernel_name346,
kernel_name347,
kernel_name348,
kernel_name349,
kernel_name350,
kernel_name351,
kernel_name352,
kernel_name353,
kernel_name354,
kernel_name355,
kernel_name356,
kernel_name357,
kernel_name358,
kernel_name359,
kernel_name360,
kernel_name361,
kernel_name362,
kernel_name363,
kernel_name364,
kernel_name365,
kernel_name366,
kernel_name367,
kernel_name368,
kernel_name369,
kernel_name370,
kernel_name371,
kernel_name372,
kernel_name373,
kernel_name374,
kernel_name375,
kernel_name376,
kernel_name377,
kernel_name378,
kernel_name379,
kernel_name380,
kernel_name381,
kernel_name382,
kernel_name383,
kernel_name384,
kernel_name385,
kernel_name386,
kernel_name387,
kernel_name388,
kernel_name389,
kernel_name390,
kernel_name391,
kernel_name392,
kernel_name393,
kernel_name394,
kernel_name395,
kernel_name396,
kernel_name397,
kernel_name398,
kernel_name399,
kernel_name400,
kernel_name401,
kernel_name402,
kernel_name403,
kernel_name404,
kernel_name405,
kernel_name406,
kernel_name407,
kernel_name408,
kernel_name409,
kernel_name410,
kernel_name411,
kernel_name412,
kernel_name413,
kernel_name414,
kernel_name415,
kernel_name416,
kernel_name417,
kernel_name418,
kernel_name419,
kernel_name420,
kernel_name421,
kernel_name422,
kernel_name423,
kernel_name424,
kernel_name425,
kernel_name426,
kernel_name427,
kernel_name428,
kernel_name429,
kernel_name430,
kernel_name431,
kernel_name432,
kernel_name433,
kernel_name434,
kernel_name435,
kernel_name436,
kernel_name437,
kernel_name438,
kernel_name439,
kernel_name440,
kernel_name441,
kernel_name442,
kernel_name443,
kernel_name444,
kernel_name445,
kernel_name446,
kernel_name447,
kernel_name448,
kernel_name449,
kernel_name450,
kernel_name451,
kernel_name452,
kernel_name453,
kernel_name454,
kernel_name455,
kernel_name456,
kernel_name457,
kernel_name458,
kernel_name459,
kernel_name460,
kernel_name461,
kernel_name462,
kernel_name463,
kernel_name464,
kernel_name465,
kernel_name466,
kernel_name467,
kernel_name468,
kernel_name469,
kernel_name470,
kernel_name471,
kernel_name472,
kernel_name473,
kernel_name474,
kernel_name475,
kernel_name476,
kernel_name477,
kernel_name478,
kernel_name479,
kernel_name480,
kernel_name481,
kernel_name482,
kernel_name483,
kernel_name484,
kernel_name485,
kernel_name486,
kernel_name487,
kernel_name488,
kernel_name489,
kernel_name490,
kernel_name491,
kernel_name492,
kernel_name493,
kernel_name494,
kernel_name495,
kernel_name496,
kernel_name497,
kernel_name498,
kernel_name499,
kernel_name500,
kernel_name501,
kernel_name502,
kernel_name503,
kernel_name504,
kernel_name505,
kernel_name506,
kernel_name507,
kernel_name508,
kernel_name509,
kernel_name510,
kernel_name511,
kernel_name512,
kernel_name513,
kernel_name514,
kernel_name515,
kernel_name516,
kernel_name517,
kernel_name518,
kernel_name519,
kernel_name520,
kernel_name521,
kernel_name522,
kernel_name523,
kernel_name524,
kernel_name525,
kernel_name526,
kernel_name527,
kernel_name528,
kernel_name529,
kernel_name530,
kernel_name531,
kernel_name532,
kernel_name533,
kernel_name534,
kernel_name535,
kernel_name536,
kernel_name537,
kernel_name538,
kernel_name539,
kernel_name540,
kernel_name541,
kernel_name542,
kernel_name543,
kernel_name544,
kernel_name545,
kernel_name546,
kernel_name547,
kernel_name548,
kernel_name549,
kernel_name550,
kernel_name551,
kernel_name552,
kernel_name553,
kernel_name554,
kernel_name555,
kernel_name556,
kernel_name557,
kernel_name558,
kernel_name559,
kernel_name560,
kernel_name561,
kernel_name562,
kernel_name563,
kernel_name564,
kernel_name565,
kernel_name566,
kernel_name567,
kernel_name568,
kernel_name569,
kernel_name570,
kernel_name571,
kernel_name572,
kernel_name573,
kernel_name574,
kernel_name575,
kernel_name576,
kernel_name577,
kernel_name578,
kernel_name579,
kernel_name580,
kernel_name581,
kernel_name582,
kernel_name583,
kernel_name584,
kernel_name585,
kernel_name586,
kernel_name587,
kernel_name588,
kernel_name589,
kernel_name590,
kernel_name591,
kernel_name592,
kernel_name593,
kernel_name594,
kernel_name595,
kernel_name596,
kernel_name597,
kernel_name598,
kernel_name599,
kernel_name600,
kernel_name601,
kernel_name602,
kernel_name603,
kernel_name604,
kernel_name605,
kernel_name606,
kernel_name607,
kernel_name608,
kernel_name609,
kernel_name610,
kernel_name611,
kernel_name612,
kernel_name613,
kernel_name614,
kernel_name615,
kernel_name616,
kernel_name617,
kernel_name618,
kernel_name619,
kernel_name620,
kernel_name621,
kernel_name622,
kernel_name623,
kernel_name624,
kernel_name625,
kernel_name626,
kernel_name627,
kernel_name628,
kernel_name629,
kernel_name630,
kernel_name631,
kernel_name632,
kernel_name633,
kernel_name634,
kernel_name635,
kernel_name636,
kernel_name637,
kernel_name638,
kernel_name639,
kernel_name640,
kernel_name641,
kernel_name642,
kernel_name643,
kernel_name644,
kernel_name645,
kernel_name646,
kernel_name647,
kernel_name648,
kernel_name649,
kernel_name650,
kernel_name651,
kernel_name652,
kernel_name653,
kernel_name654,
kernel_name655,
kernel_name656,
kernel_name657,
kernel_name658,
kernel_name659,
kernel_name660,
kernel_name661,
kernel_name662,
kernel_name663,
kernel_name664,
kernel_name665,
kernel_name666,
kernel_name667,
kernel_name668,
kernel_name669,
kernel_name670,
kernel_name671,
kernel_name672,
kernel_name673,
kernel_name674,
kernel_name675,
kernel_name676,
kernel_name677,
kernel_name678,
kernel_name679,
kernel_name680,
kernel_name681,
kernel_name682,
kernel_name683,
kernel_name684,
kernel_name685,
kernel_name686,
kernel_name687,
kernel_name688,
kernel_name689,
kernel_name690,
kernel_name691,
kernel_name692,
kernel_name693,
kernel_name694,
kernel_name695,
kernel_name696,
kernel_name697,
kernel_name698,
kernel_name699,
kernel_name700,
kernel_name701,
kernel_name702,
kernel_name703,
kernel_name704,
kernel_name705,
kernel_name706,
kernel_name707,
kernel_name708,
kernel_name709,
kernel_name710,
kernel_name711,
kernel_name712,
kernel_name713,
kernel_name714,
kernel_name715,
kernel_name716,
kernel_name717,
kernel_name718,
kernel_name719,
kernel_name720,
kernel_name721,
kernel_name722,
kernel_name723,
kernel_name724,
kernel_name725,
kernel_name726,
kernel_name727,
kernel_name728,
kernel_name729,
kernel_name730,
kernel_name731,
kernel_name732,
kernel_name733,
kernel_name734,
kernel_name735,
kernel_name736,
kernel_name737,
kernel_name738,
kernel_name739,
kernel_name740,
kernel_name741,
kernel_name742,
kernel_name743,
kernel_name744,
kernel_name745,
kernel_name746,
kernel_name747,
kernel_name748,
kernel_name749,
kernel_name750,
kernel_name751,
kernel_name752,
kernel_name753,
kernel_name754,
kernel_name755,
kernel_name756,
kernel_name757,
kernel_name758,
kernel_name759,
kernel_name760,
kernel_name761,
kernel_name762,
kernel_name763,
kernel_name764,
kernel_name765,
kernel_name766,
kernel_name767,
kernel_name768,
kernel_name769,
kernel_name770,
kernel_name771,
kernel_name772,
kernel_name773,
kernel_name774,
kernel_name775,
kernel_name776,
kernel_name777,
kernel_name778,
kernel_name779,
kernel_name780,
kernel_name781,
kernel_name782,
kernel_name783,
kernel_name784,
kernel_name785,
kernel_name786,
kernel_name787,
kernel_name788,
kernel_name789,
kernel_name790,
kernel_name791,
kernel_name792,
kernel_name793,
kernel_name794,
kernel_name795,
kernel_name796,
kernel_name797,
kernel_name798,
kernel_name799,
kernel_name800,
kernel_name801,
kernel_name802,
kernel_name803,
kernel_name804,
kernel_name805,
kernel_name806,
kernel_name807,
kernel_name808,
kernel_name809,
kernel_name810,
kernel_name811,
kernel_name812,
kernel_name813,
kernel_name814,
kernel_name815,
kernel_name816,
kernel_name817,
kernel_name818,
kernel_name819,
kernel_name820,
kernel_name821,
kernel_name822,
kernel_name823,
kernel_name824,
kernel_name825,
kernel_name826,
kernel_name827,
kernel_name828,
kernel_name829,
kernel_name830,
kernel_name831,
kernel_name832,
kernel_name833,
kernel_name834,
kernel_name835,
kernel_name836,
kernel_name837,
kernel_name838,
kernel_name839,
kernel_name840,
kernel_name841,
kernel_name842,
kernel_name843,
kernel_name844,
kernel_name845,
kernel_name846,
kernel_name847,
kernel_name848,
kernel_name849,
kernel_name850,
kernel_name851,
kernel_name852,
kernel_name853,
kernel_name854,
kernel_name855,
kernel_name856,
kernel_name857,
kernel_name858,
kernel_name859,
kernel_name860,
kernel_name861,
kernel_name862,
kernel_name863,
kernel_name864,
kernel_name865,
kernel_name866,
kernel_name867,
kernel_name868,
kernel_name869,
kernel_name870,
kernel_name871,
kernel_name872,
kernel_name873,
kernel_name874,
kernel_name875,
kernel_name876,
kernel_name877,
kernel_name878,
kernel_name879,
kernel_name880,
kernel_name881,
kernel_name882,
kernel_name883,
kernel_name884,
kernel_name885,
kernel_name886,
kernel_name887,
kernel_name888,
kernel_name889,
kernel_name890,
kernel_name891,
kernel_name892,
kernel_name893,
kernel_name894,
kernel_name895,
kernel_name896,
kernel_name897,
kernel_name898,
kernel_name899,
kernel_name900,
kernel_name901,
kernel_name902,
kernel_name903,
kernel_name904,
kernel_name905,
kernel_name906,
kernel_name907,
kernel_name908,
kernel_name909,
kernel_name910,
kernel_name911,
kernel_name912,
kernel_name913,
kernel_name914,
kernel_name915,
kernel_name916,
kernel_name917,
kernel_name918,
kernel_name919,
kernel_name920,
kernel_name921,
kernel_name922,
kernel_name923,
kernel_name924,
kernel_name925,
kernel_name926,
kernel_name927,
kernel_name928,
kernel_name929,
kernel_name930,
kernel_name931,
kernel_name932,
kernel_name933,
kernel_name934,
kernel_name935,
kernel_name936,
kernel_name937,
kernel_name938,
kernel_name939,
kernel_name940,
kernel_name941,
kernel_name942,
kernel_name943,
kernel_name944,
kernel_name945,
kernel_name946,
kernel_name947,
kernel_name948,
kernel_name949,
kernel_name950,
kernel_name951,
kernel_name952,
kernel_name953,
kernel_name954,
kernel_name955,
kernel_name956,
kernel_name957,
kernel_name958,
kernel_name959,
kernel_name960,
kernel_name961,
kernel_name962,
kernel_name963,
kernel_name964,
kernel_name965,
kernel_name966,
kernel_name967,
kernel_name968,
kernel_name969,
kernel_name970,
kernel_name971,
kernel_name972,
kernel_name973,
kernel_name974,
kernel_name975,
kernel_name976,
kernel_name977,
kernel_name978,
kernel_name979,
kernel_name980,
kernel_name981,
kernel_name982,
kernel_name983,
kernel_name984,
kernel_name985,
kernel_name986,
kernel_name987,
kernel_name988,
kernel_name989,
kernel_name990,
kernel_name991,
kernel_name992,
kernel_name993,
kernel_name994,
kernel_name995,
kernel_name996,
kernel_name997,
kernel_name998,
kernel_name999,
kernel_name1000  
};
bool hipSerialKernelLaunch(float *inputVec_h, float *inputVec_2_h,
                           float *inputVec_d, float *inputVec_2_d,
                           float *outputVec_d,
                           float *result_h,
                           size_t inputSize, 
                           size_t kernelNum, size_t blockSize, size_t gridSize) {

    hipStream_t streamSerial;
    HIPCHECK(hipStreamCreate(&streamSerial));

    HIPCHECK(hipMemcpyAsync(inputVec_d, inputVec_h, sizeof(float) * inputSize, hipMemcpyDefault, streamSerial));
    HIPCHECK(hipMemcpyAsync(inputVec_2_d, inputVec_2_h, sizeof(float) * inputSize, hipMemcpyDefault, streamSerial));
    HIPCHECK(hipMemsetAsync(outputVec_d, 0, sizeof(float) * inputSize, streamSerial));
    HIPCHECK(hipMemsetAsync(result_h, 0, sizeof(float) * inputSize, streamSerial));

    for (size_t i = 0; i < kernelNum; i++) {
        add<<<gridSize, blockSize, 0, streamSerial >>>(inputVec_d, inputVec_2_d, outputVec_d, inputSize);
    }
    HIPCHECK(hipStreamSynchronize(streamSerial));
    
    HIPCHECK(hipMemcpy(result_h, outputVec_d, sizeof(float) * inputSize, hipMemcpyDefault));
    HIPCHECK(hipStreamDestroy(streamSerial));


#if (SPACE_KERNEL == 0)
    double result_h_cpu = 0.0;
    for (int i = 0; i < BLOCK_SIZE_MIN; i++) {
        if (result_h[i] != 3.0f) {
            printf("in func: %s Final result_h[%d] != 3.0f error \n", __func__, i);
            return false;
        }
    }
#endif
    printf("[%s] success \n", __func__);
    return true;
}

bool hipGraphNodeKernelLaunch(float *inputVec_h, float *inputVec_2_h,
                              float *inputVec_d, float *inputVec_2_d,
                              float *outputVec_d, 
                              float *result_h,
                              size_t inputSize, 
                              size_t kernelNum, size_t blockSize, size_t gridSize) {

    hipGraph_t graph;
    hipStream_t streamForGraph;
    hipGraphNode_t kernelNode;
    hipKernelNodeParams kernelNodeParams = {0};
    HIPCHECK(hipStreamCreate(&streamForGraph));

    HIPCHECK(hipMemcpyAsync(inputVec_d, inputVec_h, sizeof(float) * inputSize, hipMemcpyHostToDevice, streamForGraph));
    HIPCHECK(hipMemcpyAsync(inputVec_2_d, inputVec_2_h, sizeof(float) * inputSize, hipMemcpyHostToDevice, streamForGraph));
    //HIPCHECK(hipMemsetAsync(outputVec_d, 0, sizeof(double) * numOfBlocks, streamForGraph));
    HIPCHECK(hipMemset(result_h, 0, sizeof(float) * inputSize));

    HIPCHECK(hipGraphCreate(&graph, 0));
hipGraphNode_t depNode = NULL;
    void *kernelArgs[4] = {(void *)&inputVec_d, (void *)&inputVec_2_d, (void *)&outputVec_d, &inputSize};
    memset(&kernelNodeParams, 0, sizeof(kernelNodeParams));
std::cout <<"kernelNum is "<<kernelNum<<std::endl;
    for (int i = 1; i < kernelNum+1; i++) {
        kernelNodeParams.func = (void *) kernel_funcs[i-1];
        kernelNodeParams.gridDim = dim3(gridSize, 1, 1);
        kernelNodeParams.blockDim = dim3(blockSize, 1, 1);
        kernelNodeParams.sharedMemBytes = 0;
        kernelNodeParams.kernelParams = kernelArgs;
        kernelNodeParams.extra = NULL;
        if(depNode!=NULL){
            HIPCHECK(hipGraphAddKernelNode(&kernelNode, graph, &depNode, 1, &kernelNodeParams));
        }else{
            HIPCHECK(hipGraphAddKernelNode(&kernelNode, graph, NULL, 0, &kernelNodeParams));
        }
        depNode = kernelNode;
        
    }

    hipGraphExec_t graphExec;
    //hipGraphNode_t nodes = NULL;
    //size_t numNodes = 0;
    //HIPCHECK(hipGraphGetNodes(graph, &nodes, &numNodes));
    // printf("\nNum of nodes in the graph created using hipGraphsManual API = %zu\n", numNodes);
    //HIPCHECK(hipGraphGetRootNodes(graph, &nodes, &numNodes));
    // printf("Num of root nodes in the graph created using hipGraphsManual API = %zu\n", numNodes);

    HIPCHECK(hipGraphInstantiate(&graphExec, graph, NULL, NULL, 0));

    HIPCHECK(hipGraphLaunch(graphExec, streamForGraph));  //execute graph
    HIPCHECK(hipStreamSynchronize(streamForGraph));

    hipDeviceSynchronize();
    HIPCHECK(hipMemcpy(result_h, outputVec_d, sizeof(float) * inputSize, hipMemcpyDeviceToHost));

    HIPCHECK(hipGraphExecDestroy(graphExec));
    HIPCHECK(hipGraphDestroy(graph));

    HIPCHECK(hipStreamDestroy(streamForGraph));
#if (SPACE_KERNEL == 0)
    double result_h_cpu = 0.0;
    for (int i = 0; i < BLOCK_SIZE_MIN; i++) {
        if (result_h[i] != 3.0f) {
            printf("in func: %s result_h[%d] != 3.0f error \n", __func__, i);
            return false;
        }
    }
#endif
    printf("[%s] graph success \n", __func__);
    return true;
}

bool hipGraphCaptureKernelLaunch(float *inputVec_h, float *inputVec_2_h,
                                 float *inputVec_d, float *inputVec_2_d,
                                 float *outputVec_d, float *result_h,
                                 size_t inputSize, 
                                 size_t kernelNum) {
    return true;
}

bool graphTest() {

    float *inputVec_d = NULL;
    float *inputVec_2_d = NULL;
    float *inputVec_h = NULL;
    float *inputVec_2_h = NULL;
    float *outputVec_d = NULL;
    float *result_h = NULL;

    for(unsigned int loopnum = 0; loopnum < TESTLOOP; loopnum++) {

        size_t sizeStart = 0x1u << TESTSIZE_OF_2_POWER_MIN;
        size_t sizeEnd   = 0x1u <<TESTSIZE_OF_2_POWER_MAX;
        size_t size = 0;

        size_t kernelNumStart = 0x1u << GRAPH_KERNELS_NUM_MIN;
        kernelNumStart= 80;
        size_t kernelNumEnd = 0x1u << GRAPH_KERNELS_NUM_MAX;
        size_t kernelNum = 0;

        size_t gridSizeStart = GRID_SIZE_MIN;
        size_t gridSizeEnd = GRID_SIZE_MAX;
        size_t gridSize = 0;

        size_t blockSizeStart = BLOCK_SIZE_MIN;
        size_t blockSizeEnd = BLOCK_SIZE_MAX;
        size_t blockSize = 0;

        hipSetDevice(0);
        for (size = sizeStart; size <= sizeStart; size = size*2 ){

            for (kernelNum = kernelNumStart; kernelNum <= kernelNumStart; kernelNum *= 2) {

                for (gridSize = gridSizeStart; gridSize <= gridSizeStart; gridSize += 63) {

                     for (blockSize = blockSizeStart; blockSize <= blockSizeStart; blockSize *= 2) {

                        HIPCHECK(hipHostMalloc(&inputVec_h, sizeof(float) * size, hipHostMallocDefault));
                        HIPCHECK(hipHostMalloc(&inputVec_2_h, sizeof(float) * size, hipHostMallocDefault));
                        HIPCHECK(hipHostMalloc(&result_h, sizeof(float) * size, hipHostMallocDefault));

                        for (int i = 0; i < size; i++) {
                            inputVec_h[i] = 1.0f;
                            inputVec_2_h[i] = 2.0f;
                            result_h[i] = 0.0f;
                        }

                        HIPCHECK(hipMalloc(&inputVec_d, sizeof(float) * size));
                        HIPCHECK(hipMalloc(&inputVec_2_d, sizeof(float) * size));
                        HIPCHECK(hipMalloc(&outputVec_d, sizeof(float) * size));

                        // bool statusSerial = hipSerialKernelLaunch(inputVec_h, inputVec_2_h, inputVec_d, inputVec_2_d, outputVec_d,
                        //                                           result_h, size, kernelNum, blockSize, gridSize);


                        bool statusNode = hipGraphNodeKernelLaunch(inputVec_h, inputVec_2_h, inputVec_d, inputVec_2_d, outputVec_d,
                                                                   result_h, size, kernelNum, blockSize, gridSize);

                        HIPCHECK(hipFree(inputVec_d));
                        HIPCHECK(hipFree(inputVec_2_d));
                        HIPCHECK(hipFree(outputVec_d));
                        HIPCHECK(hipHostFree(inputVec_h));
                        HIPCHECK(hipHostFree(inputVec_2_h));
                        HIPCHECK(hipHostFree(result_h));

                        // if (!statusSerial) {
                        //     printf("Failed during hip without graph\n");
                        //     exit(1);
                        // }
                        if (!statusNode) {
                            printf("Failed during hip graph Kernels \n");
                            exit(1);
                        }
                        inputVec_d = NULL;
                        inputVec_2_d = NULL;
                        inputVec_h = NULL;
                        inputVec_2_h = NULL;
                        outputVec_d = NULL;
                        result_h = NULL;

                    }

                }
                
            }

        }
    }
    return true;
}

int main(int argc, char **argv) {
    graphTest();
    return 0;
}
